<?php 
   $post = $_POST;
   if(empty($post['curl'])){
        ajax_return('请上传内容');
   }
   function ajax_return($msg,$data=array(),$status=0){
     return json_encode(array('msg'=>msg,'data'=>$data,'status'=>$status));
   }
   $content = $post['content'];
   $arr = explode("\r\n",$content);
   $curl = $post['curl'];

   $str = $post['testweibo'];

   $is_windows = 1;

   if($is_windows){
        $str = str_replace('%','"%"',urlencode($str));
   }else{
        $str = urlencode($str);
   }
   $time = time();
   $show = array();
   foreach($arr as $item){
      $sec = rand(10,20);
      $time = $time+$sec;
      $rnd = $time.rand(100,999);
      $show_str = $is_windows?str_replace($str,str_replace('%','"%"',urlencode($item)),$curl):str_replace($str,urlencode($item),$curl);
      $show_str = preg_replace('/__rnd=(\d)+/',$rnd,$show_str);
      $show_str."<br/>ping -n {$sec} 127.1>nul<br/>";
      $show[]=$show_str;
   }
$show = implode("<br/>",$show);
echo ajax_return('成功',array('data'=>$show),1);